{extend name="adminblue/base" /}
{block name="resources"/} {/block}
{block name="right_tab"}
<li><a class="nscs-table-handle_green" href="Partner/addPartnerLevel"><i class="fa fa-plus-circle"></i>&nbsp;添加</a></li> 
{/block}
{block name="main"}
<div class="mod-table">
	<div class="mod-table-head">
		<div class="con style0list">
			<table>
				<colgroup>
					<col style="width: 5%;">
					<col style="width: 10%;">
					<col style="width: 10%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
				</colgroup>
				<thead>
					<tr>
						<th><label style="margin-left: 5px;"> <input type="checkbox"  onclick="CheckAll(this)"></label></th>
						<th>等级名称</th>
						<th>等级条件</th>
						<th>股东分红佣金比率</th>
						<th>全球分红分值</th>
						<th>全球分红权重</th>
						<th>创建时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<colgroup>
					<col style="width: 5%;">
					<col style="width: 10%;">
					<col style="width: 10%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
				</colgroup>
				<tbody></tbody>
			</table>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">	
	//加载数据
	function LoadingInfo(pageIndex) {
		$.ajax({
			type : "post",
			url : "{:__URL('ADMIN_MAIN/Distribution/partnerLevelList')}",
			async : true,
			data : {
				"pageIndex" : pageIndex
			},
			success : function(data) {
				$("#page_count").val(data["page_count"]);
				$("#pageNumber a").remove();
				var html = '';
				if (data["data"].length > 0) {
					for (var i = 0; i < data["data"].length; i++) {
						html += '<tr align="center">';
						html += '<td><div class="cell"><label ><input name="sub" type="checkbox" value="'+ data["data"][i]["promoter_id"] +'" ></label></div></td>';
						html += '<td>' + data["data"][i]["level_name"] + '</td>';
						html += '<td>' + data["data"][i]["level_money"] + '</td>';
						html += '<td>' + data["data"][i]["commission_rate"] + '</td>';
						html += '<td>' + data["data"][i]["global_value"] + '</td>';
						html += '<td>' + data["data"][i]["global_weight"] + '</td>';
						html += '<td>' + timeStampTurnTime(data["data"][i]["create_time"]) + '</td>';
						html += '<td><a href="'+__URL('ADMIN_MAIN/Partner/updatePartnerLevel?level_id='+ data["data"][i]["level_id"])+'">修改</a></td> ';
						html += '</tr>';
					}
				} else {
					html += '<tr align="center"><th colspan="9">暂无符合条件的数据记录</th></tr>';
				}
				
				$(".style0list tbody").html(html);
				var totalpage = $("#page_count").val();
				if (totalpage == 1) {
					changeClass("all");
				}
				var $html = pagenumShow(jumpNumber,totalpage,{$pageshow})
				$("#pageNumber").append($html);
			}
		});
	}	
	//全选
	function CheckAll(event){
		var checked = event.checked;
		$(".style0list tbody input[type = 'checkbox']").prop("checked",checked);
	}
</script>
{/block}